{% import "components/user.html" as user %}
{% extends "domain_base.html" %}
{% block domain_content %}
{% if domain.bulletin %}
<div class="section">
  <div class="section__body typo richmedia">
    {{ domain.bulletin|markdown|safe }}
  </div>
</div>
{% endif %}
<div class="section">
  <div class="section__header">
    <h1 class="section__title" data-heading>{{ _('Information') }}</h1>
    <div class="section__tools">
      <form method="post">
        <input type="hidden" name="operation" value="init_discussion_node">
        <button type="submit" class="primary rounded button"><span class="icon icon-wrench"></span> {{ _('Init Discussion Nodes') }}</button>
      </form>
    </div>
  </div>
  <div class="section__body typo">
    <dl class="large horizontal">
    <dt>{{ _('Avatar') }}</dt><dd><img src="{{ avatarUrl(domain.avatar) }}" width="32" height="32"></dd>
    <dt>{{ _('Name') }}</dt><dd>{{ domain.name }}</dd>
    <dt>{{ _('Owner') }}</dt><dd>{{ user.render_inline(owner) }}</dd>
    </dl>
  </div>
</div>
{% if handler.user._id == owner._id %}
<div class="section">
  <div class="section__header">
    <h1 class="section__title" data-heading>{{ _('Delete Domain') }}</h1>
    <div class="section__tools">
      <form method="POST" id="delete-domain-form">
        <div>
          <input type="hidden" name="operation" value="delete">
          <input type="submit" value="{{ _('Delete Domain') }}" class="rounded primary button">
        </div>
      </form>
    </div>
  </div>
  <div class="section__body"></div>
</div>
{% endif %}
{% endblock %}
